﻿namespace WSKnowledge.WSHelpers.NHibernate
{
	public class NamedEntityMap<TEntity> : EntityMap<TEntity>
		where TEntity : INamedEntity<TEntity>
	{
		protected NamedEntityMap()
		{
			// According to StringRule defined in NamedEntityBase
			Map(p => p.Name)
				.WithLengthOf(50)
				.UniqueKey(GetUniqueKeyFor("Name"))
				.Not.Nullable();
		}
	}
}
